package com.dbh.company.buildbook.bean;

import com.dbh.company.buildbook.bean.ConfigVO;

import java.io.Serializable;
import java.util.List;

/**
 * @author dylan
 */
public class RespBase<T> implements Serializable {
    private static final long serialVersionUID = 1747083586585252568L;
    private int errno;
    private String errmsg;
    private String traceId;
    private ConfigVO data;

    public int getErrno() {
        return errno;
    }

    public void setErrno(int errno) {
        this.errno = errno;
    }

    public String getErrmsg() {
        return errmsg;
    }

    public void setErrmsg(String errmsg) {
        this.errmsg = errmsg;
    }

    public String getTraceId() {
        return traceId;
    }

    public void setTraceId(String id) {
        this.traceId = id;
    }

    public ConfigVO getData() {
        return data;
    }

    public void setData(ConfigVO data) {
        this.data = data;
    }


    public String toShortString() {
        String dataStr = null;
        if (data != null) {
            if (data instanceof List) {
                dataStr = "listsize=" + ((List) data).size();
            } else {
                dataStr = data.toString();
            }
        }
        return String.format("errno:%s,errmsg:%s,id=%s,data:%s", errno, errmsg, traceId, dataStr);

    }


}